<?php


namespace app\api\controller\uniapp;

use app\common\controller\Api;


/**
 * 小程序商品接口
 * Class Index
 * @package app\api\controller\uniapp
 */
class Goods extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    protected $service = null;

    public function _initialize()
    {
        parent::_initialize();
        $version = str_replace(".","",$this->version);
        $className = basename(__CLASS__);
        $serviceName = "app\\api\\service\\uniapp\\goods\\Goods{$version}";
        $this->service = new $serviceName;
    }

    public function get_goods(){
        //接收参数
        $goodsid = $this->request->param('goodsid',0);
        return $this->service->get_goods($goodsid);
    }
}